import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect:'/product/index',
    component:()=>import('/src/views/HomeView'),
    children:[
      {
        path:'/product/index',
        component: () => import('../views/sys-user/product/IndexView.vue')
      },
      {
        path:'/sys-user/product/new_client',
        component: () => import('../views/sys-user/product/NewClientView')
      },
      {
        path:'/sys-user/product/cart',
        component: () => import('../views/sys-user/product/Cart.vue')
      },
      {
        path:'/sys-user/product/orders',
        component: () => import('../views/sys-user/product/Orders.vue')
      },
      {
        path:'/sys-user/product/brand',
        component: () => import('../views/sys-user/product/BrandPavilionView')
      },
      {
        path:'/sys-user/product/brand/brand-product',
        component: () => import('../views/sys-user/product/BrandProductView')
      },
      {
        path:'/sys-user/pet/pet-management',
        component: () => import('../views/sys-user/pet/PetIndexView')
      },
      {
        path:'/sys-user/pet/pet-management/adopt',
        component: () => import('../views/sys-user/pet/PetAdoptView')
      },
      {
        path:'/sys-user/product/details',
        component: () => import('../views/sys-user/product/Details.vue')
      },
      {
        path:'/sys-user/product/comment',
        component: () => import('../views/sys-user/product/Comment.vue')
      },
      {
        path: '/sys-user/product/login',
        component: () => import('../views/sys-user/product/UserListView.vue')
      },
      {
        path: '/sys-user/product/reg',
        component: () => import('../views/sys-user/product/UserAddNewView.vue')
      },
      {
        path: '/sys-user/footers/afterSalesService',
        component: () => import('../views/sys-user/footers/AfterSalesService.vue')
      },
      {
        path: '/sys-user/footers/questions',
        component: () => import('../views/sys-user/footers/Questions.vue')
      },
      {
        path: '/sys-user/footers/help',
        component: () => import('../views/sys-user/footers/Help.vue')
      },
      {
        path: '/sys-user/footers/gettingStarted',
        component: () => import('../views/sys-user/footers/GettingStarted.vue')
      },
      {
        path: '/sys-user/footers/purchaseMethods',
        component: () => import('../views/sys-user/footers/PurchaseMethods.vue')
      },
      {
        path: '/sys-user/product/searchQuery',
        component: () => import('../views/sys-user/product/SearchQueryView.vue')
      },
    ]
  },
  {
    path: '/about',
    name: 'about',
    component: () => import('../views/AboutView.vue')
  },
  {
    path: '/userupdate',
    component: () => import('../views/UserUpdateView.vue')
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
